package com.eClass.dados;

import java.sql.ResultSet;
import java.sql.SQLException;

import javax.swing.JOptionPane;

public class RepositorioLogin {
	private ConectarOracle c = null;
	private ResultSet rs = null;

	public RepositorioLogin() {
		try {
			c = new ConectarOracle();
		} catch (ClassNotFoundException e) {
			e.printStackTrace();
		}
	}

	public ResultSet realizarLogin(String login, String senha) {
		String query = "CALL RealizarLogin('" + login + "','" + senha + "')";
		try {
			rs = c.getStmt().executeQuery(query);
		} catch (SQLException sqlex) {
			JOptionPane.showMessageDialog(null, sqlex.getMessage(), "ERRO!",
					JOptionPane.ERROR_MESSAGE);
		}
		return rs;
	}

	public int getTipoUsuario() {
		return 1;
	}
}
